package com.itheima;

import com.itheima.config.MyBeanFactoryPostProcessor;
import com.itheima.config.MyImportSelector;
import com.itheima.config.UserFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.Order;

/**
 * @program: Spring_day02_01_注解_IoC注解
 * @description:
 * @author: zhanghz001
 * @create: 2020-11-27 17:04
 **/
//代表了application.xml
@Configuration
//代表context:component-scan
@ComponentScan(value = "com.itheima")
//导入第三方bean作为spring控制的资源
//
//         MyImportBeanDefinitionRegistrar.class,
//         MyBeanPostProcessor.class,

// @Import({JDBCConfig.class, MyImportSelector.class,
//         MyBeanFactoryPostProcessor.class
// })
@Import({UserFactoryBean.class,
        MyImportSelector.class,
        MyBeanFactoryPostProcessor.class})
//数字越大越后面去
@Order(3)
public class Application {
    @Bean
    public String getStr1() {
        System.out.println("application1");
        return "application1";
    }
}
